package com.yyge.controller.admin.mapstruct;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yyge.common.vo.resp.PageResp;
import com.yyge.controller.admin.shoppingcart.req.ShoppingCartReq;
import com.yyge.controller.admin.shoppingcart.resp.ShoppingCartResp;
import com.yyge.entity.ShoppingCart;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface ShoppingCartConverter {
    ShoppingCartConverter MAPPER = Mappers.getMapper(ShoppingCartConverter.class);

     @Mapping(source="records",target="rows")
     PageResp page2vo(Page list);

     ShoppingCart shoppingcart2req(ShoppingCartReq req);
     List<ShoppingCartResp> shoppingcart2resp(List<ShoppingCart> list);
}
